package com.net.oil.user.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.user.contract.ChangeLoginPasswordContract;
import com.net.oil.user.model.ChangeLoginPasswordModel;

/**
 * 作者：lch
 * 时间：2018/4/2:15:46
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class ChangeLoginPasswordPresenter extends BasePresenter<ChangeLoginPasswordContract.View> implements ChangeLoginPasswordContract.Presenter {

    private ChangeLoginPasswordContract.View view;
    private ChangeLoginPasswordContract.Model model;

    public ChangeLoginPasswordPresenter(ChangeLoginPasswordContract.View view) {
        this.view = view;
        model = new ChangeLoginPasswordModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void changePassword(String oldPassword, String newPassword) {
        model.changePassword(oldPassword, newPassword);
    }

    @Override
    public void changePasswordSuccess() {
        view.changePasswordSuccess();
    }

    @Override
    public void changePasswordFailed() {
        view.changePasswordFailed();
    }
}
